﻿using LiteBlog.Common.Components;
using LiteBlog.Common.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LiteBlog.Models
{
    public class PostCollectionModel
    {
        public List<Post> PostCollection { get; set; }
        public Author Author { get; set; }
        public int Page { get; set; }
        public int PageCount { get; set; }
        public string FilterId { get; set; }
        public string FilterName { get; set; }
        public UrlType UrlType { get; set; }

        public bool NextPageAvailable
        {
            get
            {
                return Page < PageCount;
            }
        }

        public string NextPageUrl
        {
            get
            {
                return UrlHelper.GetUrl(UrlType, FilterId) + "?page=" + (Page+1).ToString(); 
            }
        }
    }
}
